/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.andersen.database.entity;

import java.sql.Date;

/**
 *
 * @author Corvus 11
 */
public class StateEntity {
    
    public static final char STATUS_OK = '\u0000';
    public static final char STATUS_BROKEN = 'X';
    public static final char STATUS_REPAIR = 'R';
    
    private long id;
    
    private long componentId;
    
    private ComponentEntity component;
    
    private Date fromDate;
    
    private Date toDate;
    
    private long employeeId;
    
    private EmployeeEntity employee;
    
    private long computerId;
    
    private ComponentEntity computer;
    
    private long officeId;
    
    private OfficeEntity office;
    
    private char status;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getComponentId() {
        return componentId;
    }

    public void setComponentId(long componentId) {
        this.componentId = componentId;
    }

    public ComponentEntity getComponent() {
        return component;
    }

    public void setComponent(ComponentEntity component) {
        this.component = component;
    }

    public Date getFromDate() {
        return fromDate;
    }

    public void setFromDate(Date fromDate) {
        this.fromDate = fromDate;
    }

    public Date getToDate() {
        return toDate;
    }

    public void setToDate(Date toDate) {
        this.toDate = toDate;
    }

    public long getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(long employeeId) {
        this.employeeId = employeeId;
    }

    public EmployeeEntity getEmployee() {
        return employee;
    }

    public void setEmployee(EmployeeEntity employee) {
        this.employee = employee;
    }

    public long getComputerId() {
        return computerId;
    }

    public void setComputerId(long computerId) {
        this.computerId = computerId;
    }

    public ComponentEntity getComputer() {
        return computer;
    }

    public void setComputer(ComponentEntity computer) {
        this.computer = computer;
    }

    public long getOfficeId() {
        return officeId;
    }

    public void setOfficeId(long officeId) {
        this.officeId = officeId;
    }

    public OfficeEntity getOffice() {
        return office;
    }

    public void setOffice(OfficeEntity office) {
        this.office = office;
    }

    public char getStatus() {
        return status;
    }

    public void setStatus(char status) {
        this.status = status;
    }
    
    public String getStatusDescription() {
        switch (status) {
            case STATUS_BROKEN: return "Неисправно";
            case STATUS_REPAIR: return "В ремонте";
        }
        return "Исправно";
    }

    @Override
    public String toString() {
        return "StateEntity{" + "id=" + id + 
                ", componentId=" + componentId + 
                ", component=" + component + 
                ", fromDate=" + fromDate + 
                ", toDate=" + toDate + 
                ", employeeId=" + employeeId + 
                ", employee=" + employee + 
                ", computerId=" + computerId + 
                ", computer=" + computer + 
                ", officeId=" + officeId + 
                ", office=" + office + 
                ", status=" + status + '}';
    }
    
    
    
}
